<?php

namespace Respect\Http\Module;

use Respect\Http\Bootstrappable;
use Respect\Environment\EnvironmentableInterface;

class Charset extends NegotiationAbstract implements Bootstrappable
{

    public function __construct(EnvironmentableInterface $env)
    {
        $this->requested = $this->parseHeader($env['HTTP_ACCEPT_CHARSET']);
    }

    public static function qualify(EnvironmentableInterface $env)
    {
        return $env['HTTP_ACCEPT_CHARSET'] ? new static($env) : false;
    }

}